---
layout: example.html
title: Layer Opacity
shortdesc: Adjust layer opacity based on user input
docs: >
  The `layer.setOpacity()` method can be called to adjust the opacity of a layer.
tags: "opacity"
cloak:
  - key: get_your_own_D6rA4zTHduk6KOKTXzGB
    value: Get your own API key at https://www.maptiler.com/cloud/
---
<div id="map" class="map"></div>
<label>
  Layer opacity
  <input id="opacity-input" type="range" min="0" max="1" step="0.01" value="1" />
  <span id="opacity-output"></span>
</label>
